Attribute VB_Name = "Brain" Option Explicit Global HTMLData As Boolean Dim htmrows As Long Dim htmcols As Long Dim htmtitle As String Sub main() HTMLData = False frmHTMLEditor.Show End Sub Function AddLinkTable(ColumnCount As Long, RowCount As Long, TitleLine As String) As String 'Add table with embedded HTML links Dim temp$ Dim j As Long Dim k As Long Dim quote$ quote$ = Chr$(34) temp$ = "" & vbCrLf temp$ = temp$ & "" & vbCrLf temp$ = temp$ & "" & vbCrLf temp$ = temp$ & "" & vbCrLf For j = 1 To RowCount temp$ = temp$ & "" & vbCrLf & "" & vbCrLf If ColumnCount > 1 Then For k = 2 To ColumnCount temp$ = temp$ & "" & vbCrLf Next k End If temp$ = temp$ & "" & vbCrLf & vbCrLf Next j temp$ = temp$ & "
" & TitleLine & "
" & "sitelbl" & "
" & "sitelbl" & "
" & vbCrLf & "
" & vbCrLf AddLinkTable = temp$ End Function Function AddTable(ColumnCount As Long, RowCount As Long, TitleLine As String) As String 'Add table Dim temp$ Dim j As Long Dim k As Long Dim quote$ quote$ = Chr$(34) temp$ = "" & vbCrLf temp$ = temp$ & "" & vbCrLf temp$ = temp$ & "" & vbCrLf temp$ = temp$ & "" & vbCrLf For j = 1 To RowCount temp$ = temp$ & "" & vbCrLf & "" & vbCrLf If ColumnCount > 1 Then For k = 2 To ColumnCount temp$ = temp$ & "" & vbCrLf Next k End If temp$ = temp$ & "" & vbCrLf & vbCrLf Next j temp$ = temp$ & "
" & TitleLine & "
" & "data" & "
" & "data" & "
" & vbCrLf & "
" & vbCrLf AddTable = temp$ End Function Function AddPicElement(PictureName As String, BorderValue As Integer) As String AddPicElement = "" & vbCrLf End Function Sub ColorsOn() With frmHTMLEditor .cmdBTApproved.Visible = True .rtbHTML.Visible = False .txtPicture.Visible = True .cmdPicture.Visible = True .Label1(4).Visible = True .Combo1.Visible = True .Combo2.Visible = True .Combo3.Visible = True .Combo4.Visible = True .Label1(0).Visible = True .Label1(1).Visible = True .Label1(2).Visible = True .Label1(3).Visible = True .cmdColorDone.Visible = True .cmdCancelColor.Visible = True .Combo1.SetFocus End With End Sub Sub ColorsOff() With frmHTMLEditor .cmdBTApproved.Visible = False .rtbHTML.Visible = True .txtPicture.Visible = False .cmdPicture.Visible = False .Label1(4).Visible = False .Combo1.Visible = False .Combo2.Visible = False .Combo3.Visible = False .Combo4.Visible = False .Label1(0).Visible = False .Label1(1).Visible = False .Label1(2).Visible = False .Label1(3).Visible = False .cmdColorDone.Visible = False .cmdCancelColor.Visible = False End With End Sub Sub StuffColors(Trgt As ComboBox) Trgt.Clear Trgt.AddItem "Aqua" Trgt.AddItem "Black" Trgt.AddItem "Blue" Trgt.AddItem "Fuchsia" Trgt.AddItem "Gray" Trgt.AddItem "Green" Trgt.AddItem "Lime" Trgt.AddItem "Maroon" Trgt.AddItem "Navy" Trgt.AddItem "Olive" Trgt.AddItem "Purple" Trgt.AddItem "Red" Trgt.AddItem "Silver" Trgt.AddItem "Teal" Trgt.AddItem "White" Trgt.AddItem "Yellow" Trgt.Text = "White" End Sub Function BodyColorScheme() As String Dim temp$ Dim quote$ quote$ = Chr$(34) ' With frmHTMLEditor ' If Len(Trim(.txtPicture.Text)) < 1 Then temp$ = "" Else temp$ = "" End If End With BodyColorScheme = temp$ End Function Function PickAPicture() As String With frmHTMLEditor .CommonDialog1.DialogTitle = "Select a picture file." .CommonDialog1.Flags = &H4& Or &H2& .CommonDialog1.DefaultExt = "JPG" .CommonDialog1.Filter = "JPeg (*.jpg)|*.jpg|GIF (*.gif)|*.gif|BMP (*.BMP)|*.bmp" .CommonDialog1.ShowOpen PickAPicture = .CommonDialog1.FileName End With End Function Sub SaveAPage() With frmHTMLEditor .CommonDialog1.DialogTitle = "SAVE HTML FILE" .CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)" .CommonDialog1.DefaultExt = "HTML" .CommonDialog1.Flags = &H4& Or &H2& .CommonDialog1.ShowSave Dim fileNum As Integer fileNum = FreeFile If .CommonDialog1.FileName <> "" Then Open .CommonDialog1.FileName For Output As #fileNum Print #fileNum, .rtbHTML.Text Close #fileNum End If End With End Sub Sub LoadAPage(mode As Boolean) 'if mode is false, replace selected text (insert) 'if mode if true, replace all text (load) Dim temp$ Dim Big$ Dim fileNum As Integer fileNum = FreeFile With frmHTMLEditor .CommonDialog1.DialogTitle = "LOAD HTML FILE" .CommonDialog1.Filter = "HTML Files (*.html)|*.html|HTM Files (*.htm)|*.htm)" .CommonDialog1.DefaultExt = "HTML" .CommonDialog1.Flags = &H4& Or &H2& .CommonDialog1.ShowOpen If .CommonDialog1.FileName <> "" Then frmHTMLEditor.rtbHTML.LoadFile .CommonDialog1.FileName ' Open .CommonDialog1.FileName For Input As #fileNum ' Do While Not EOF(fileNum) ' Line Input #fileNum, temp$ ' Debug.Print temp$ ' Big$ = Big$ & temp$ ' Loop ' Close #fileNum End If If mode = True Then 'Overwrite mode ' .rtbHTML.SelStart = 0 ' .rtbHTML.SelLength = Len(.rtbHTML.Text) ' .rtbHTML.SelRTF = Big$ Else 'Insert mode .rtbHTML.SelLength = 0 .rtbHTML.SelRTF = Big$ End If End With End Sub